package com.haixiaoke.saas.contract.service.impl;

import java.util.List;

import com.haixiaoke.saas.common.utils.DateUtils;
import com.haixiaoke.saas.contract.domain.ElectronicVisa;
import com.haixiaoke.saas.contract.mapper.ElectronicVisaMapper;
import com.haixiaoke.saas.contract.service.IElectronicVisaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 企业电子签信息Service业务层处理
 * 
 * @author panda
 * @date 2025-07-01
 */
@Service
public class ElectronicVisaServiceImpl implements IElectronicVisaService {
    @Autowired
    private ElectronicVisaMapper electronicVisaMapper;

    /**
     * 查询企业电子签信息
     * 
     * @param visaId 企业电子签信息主键
     * @return 企业电子签信息
     */
    @Override
    public ElectronicVisa selectElectronicVisaByVisaId(Long visaId) {
        return electronicVisaMapper.selectElectronicVisaByVisaId(visaId);
    }

    /**
     * 查询企业电子签信息列表
     * 
     * @param electronicVisa 企业电子签信息
     * @return 企业电子签信息
     */
    @Override
    public List<ElectronicVisa> selectElectronicVisaList(ElectronicVisa electronicVisa) {
        return electronicVisaMapper.selectElectronicVisaList(electronicVisa);
    }

    /**
     * 新增企业电子签信息
     * 
     * @param electronicVisa 企业电子签信息
     * @return 结果
     */
    @Override
    public int insertElectronicVisa(ElectronicVisa electronicVisa) {
        electronicVisa.setCreateTime(DateUtils.getNowDate());
        return electronicVisaMapper.insertElectronicVisa(electronicVisa);
    }

    /**
     * 修改企业电子签信息
     * 
     * @param electronicVisa 企业电子签信息
     * @return 结果
     */
    @Override
    public int updateElectronicVisa(ElectronicVisa electronicVisa) {
        electronicVisa.setUpdateTime(DateUtils.getNowDate());
        return electronicVisaMapper.updateElectronicVisa(electronicVisa);
    }

    /**
     * 批量删除企业电子签信息
     * 
     * @param visaIds 需要删除的企业电子签信息主键
     * @return 结果
     */
    @Override
    public int deleteElectronicVisaByVisaIds(Long[] visaIds) {
        return electronicVisaMapper.deleteElectronicVisaByVisaIds(visaIds);
    }

    /**
     * 删除企业电子签信息信息
     * 
     * @param visaId 企业电子签信息主键
     * @return 结果
     */
    @Override
    public int deleteElectronicVisaByVisaId(Long visaId) {
        return electronicVisaMapper.deleteElectronicVisaByVisaId(visaId);
    }
}
